package com.whfc.fse.dao;

import com.whfc.entity.dto.warn.AppWarnRuleDTO;
import com.whfc.fse.entity.FseWarnRule;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FseWarnRuleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(FseWarnRule record);

    int insertSelective(FseWarnRule record);

    FseWarnRule selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(FseWarnRule record);

    int updateByPrimaryKey(FseWarnRule record);

    /**
     * 查找报警规则
     *
     * @param deptId
     * @param ruleType
     * @return
     */
    Integer selectByDeptIdAndRuleType(@Param("deptId") Integer deptId, @Param("ruleType") Integer ruleType);

    List<AppWarnRuleDTO> selectAllRulesByDeptId(@Param("deptId") Integer deptId,
                                                @Param("type") Integer type);

    void batchInsert(@Param("list") List<FseWarnRule> list);
}